
#include "VCom.h"
#include "Receivers.h"
#include "SysClock.h"
#include "debug.h"
#include "App.h"
#include "Init.h"
#include "Sys.h"
#include "cmdp.h"
#include "outp_drv.h"
#include "OS.h"




unsigned int MainLoopCounter, gtmp;

int main ( void )
{
	Init_Device();

	for(;;)							  /* main loop */
	{
		/* Drive USB (virtual com.port) */
		Drive_VCOM();
		/* Drivers of USARTs */
		Drive_Receivers();
		cmd_monitor();
		SysClock();
		//dtmf_monitor();
		//isd_driver();

		OS_Apps();

		
		Out_Drive();
		
		/* watchdog timer */
		WDT_Reload();

		MainLoopCounter++;
		if ( SYS_CLOCK_10sec )
		{
			gtmp = 10000000;
			gtmp /= MainLoopCounter;
			MainLoopCounter = 0;
			DBG("\n MainLoop: %d uSec\r", gtmp);
		}
	}

	return 0;
}







